{include file='_header'}
<div class="page-header">
    当前位置：<span class="text-primary">商品分类</span>
</div>
<div class="page-content">
    <div class="page-toolbar">
        <span class=''>
            <a class="btn btn-primary btn-sm" href="{:url('admin/creditshop/categoryadd')}">添加新商品分类</a>
        </span>
    </div>
    {if count($list)>0}
        <table class="table table-hover table-responsive">
            <thead class="navbar-inner">
                <tr>
                    <th style="width:50px;">ID</th>
                    <th style='width:80px'>显示顺序</th>
                    <th>标题</th>
                    <th style="width: 100px">状态</th>
                    <th style="width: 65px;">操作</th>
                </tr>
            </thead>
            <tbody id="sort">
                {foreach name='list' item='row'}
                    <tr>
                        <td>{$row['id']}</td>
                        <td>
                            <a href='javascript:;' data-toggle='ajaxEdit' data-href="{:url('admin/creditshop/categorydisplayorder',array('id'=>$row['id']))}" >{$row['displayorder']}</a>
                        </td>
                        <td><img src='{$row['thumb']}' style='width:30px;height:30px;padding:1px;border:1px solid #ccc'  onerror="this.src='/public/static/images/nopic.png'"/> {$row['name']}</td>
                        <td>
                            <span class='label {if $row['enabled']==1}label-primary{else}label-default{/if}'
                                  data-toggle='ajaxSwitch'
                                  data-switch-value='{$row['enabled']}'
                                  data-switch-value0='0|隐藏|label label-default|{:url('admin/creditshop/categoryenabled',array('enabled'=>1,'id'=>$row['id']))}'
                                  data-switch-value1='1|显示|label label-primary|{:url('admin/creditshop/categoryenabled',array('enabled'=>0,'id'=>$row['id']))}'
                              >
                              {if $row['enabled']==1}显示{else}隐藏{/if}</span>
                        </td>
                        <td style="text-align:left;">
                            <a href="{:url('admin/creditshop/categoryedit', array('id' => $row['id']))}" class="btn btn-default btn-sm btn-op btn-operation" >
                                  <span data-toggle="tooltip" data-placement="top" title="" data-original-title="修改">
                                    <i class='icow icow-bianji2'></i>
                               </span>
                            </a>
                            <a data-toggle='ajaxRemove' href="{:url('admin/creditshop/categorydelete', array('id' => $row['id']))}"class="btn btn-default btn-sm btn-op btn-operation" data-confirm="确认删除此分类?" title="删除">
                                 <span data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">
                                 <i class="icow icow-shanchu1"></i>
                               </span>
                            </a>
                        </td>
                    </tr>
                {/foreach}
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="5" class="text-right">
                        {$pager}
                    </td>
                </tr>
            </tfoot>
        </table>
    {else}
        <div class='panel panel-default'>
            <div class='panel-body' style='text-align: center;padding:30px;'>暂时没有任何商品分类</div>
        </div>
    {/if}
</div>
{include file='_footer'}